package com.example.dddsample.infrastructure.persistence.assembler;

import com.example.dddsample.domain.entity.CustomerAggregate;
import com.example.dddsample.infrastructure.persistence.assembler.mapper.CustomerAggregateMapper;
import com.example.dddsample.infrastructure.persistence.po.CustomerPo;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CustomerAggregateAssembler {
    public CustomerPo assemblerFromCustomerPo(CustomerAggregate customerPo){
        return CustomerAggregateMapper.INSTANCE.fromCustomerAggregate(customerPo);
    }

    public List<CustomerPo> assemblerFromCustomerPoList(List<CustomerAggregate> list){
        return CustomerAggregateMapper.INSTANCE.fromCustomerAggregateList(list);
    }
}
